<template>
  <div class="mt20">
    <!-- 借款记录 -->
    <div class="phonelist mt20">
        <p class="title">{{$t('operationDetail.no45')}}</p>
        <el-table :data="collectionList" stripe size="small" style="width: 100%" >
          <el-table-column align="center" prop="contactName" :label="$t('public.name')">
          </el-table-column>
          <el-table-column align="center" prop="relationName" :label="$t('public.no17')">
          </el-table-column>
          <el-table-column align="center" prop="contactPhone" :label="$t('public.no18')">
          </el-table-column>
          <el-table-column align="center" prop="type" :label="$t('operationDetail.no16')">
            <template slot-scope="scope">
              <span>{{scope.row.type==1?$t('operationDetail.type.no1'):$t('operationDetail.type.no2')}}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="status" :label="$t('operationDetail.no17')">
            <template slot-scope="scope">
                {{$t('operationDetail.no10')+':'+$t($store.getters.operationStatus(scope.row.status))}},
                {{$t('operationDetail.no7')+':'+(scope.row.promise==1?$t('operationDetail.no11'):$t('operationDetail.no12'))}},
                {{$t('operationDetail.no8')+':'}}{{scope.row.promiseTime | dataIsTrue}},
                {{$t('operationDetail.no9')+':'}}{{scope.row.remark | dataIsTrue}}
            </template>
          </el-table-column>
          <el-table-column align="center" prop="adminName" :label="$t('operationDetail.no18')">
          </el-table-column>
          <el-table-column align="center" prop="createTime" :label="$t('operationDetail.no19')">
          </el-table-column>
        </el-table>
        <el-row type="flex" justify="end">
            <div class="pages" >
                <el-pagination
                @current-change="handleCurrentChange"
                :current-page="pagination.current"
                layout="sizes, prev, pager, next, total,->"
                :page-sizes="pagination.pageSizeOptions"
                :page-size="pagination.pageSize"
                @size-change="handleSizeChange"
                :total="pagination.total">
                </el-pagination>
            </div>
            </el-row>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        pagination: {
            pageSize: global.config.pageSize,
            pageSizeOptions: global.config.pageSizeOptions,
            current: 1,
            total: 0,
        },
        collectionList:[]
      }
    },
    methods: {
      handleSizeChange (val) {// 每页条数变化时操作
        this.pagination.pageSize = val;
        this.getTableData();
        },
        handleCurrentChange (val) { // 分页按钮点击操作
        this.pagination.current = val;
        this.getTableData();
        },
        getTableData () { // 获取初审列表数据
        let option = {
            pageNum:this.pagination.current,
            pageSize:this.pagination.pageSize,
            param: {
              orderId:this.$route.query.orderId
            }       
        }
        this.$axios.post(this.$action.collection_record, option).then(res => {
            if (res.code == 200) {
            this.collectionList = res.data.list;
            this.pagination.total = res.data.total;
            }else{
            this.$globalMsg.error(res.message)
            }
        })
        }
    },
    mounted() {
      this.getTableData();
    }
  }
</script>
